
import random
from ronglian_sms_sdk import SmsSDK

accountSid = "8aaf07087fe90a32017ff2c51866017e"
accountToken = 'ad87a473199446aeab78f5c52f9b912e'
appId = '8aaf07087de13e49017dff9ee25706b0'


def sms_code(mobile):
    tid = '1'
    num = random.randint(1000, 9999)
    datas = (num, '5')
    rest = SmsSDK(accountSid, accountToken,appId).sendMessage(tid, mobile, datas)
    return rest,num